﻿using System;
using System.Collections.Generic;

using NUnit.Framework;

using Supremacy.AI;
using Supremacy.Game;
using Supremacy.Orbitals;

namespace Supremacy.Tests.SupremacyCore.AI
{
    [TestFixture]
    public class ProductionAITests
    {
        private GameContext _game;

        [TestFixtureSetUp]
        public void CreateGame()
        {
            Environment.CurrentDirectory = @"..\..\..\SupremacyClient\bin\Debug\";
            AppDomain.CurrentDomain.SetData("DataDirectory", Environment.CurrentDirectory);

            var players = new List<Player>();

            _game = GameContext.Create(GameOptionsManager.LoadDefaults(), false);

            PlayerContext.Current = new PlayerContext(players);
            GameContext.Push(_game);

            var localPlayer = new Player
                              {
                                  EmpireID = 0,
                                  PlayerID = 0,
                                  Name = "TestDriver"
                              };

            players.Add(localPlayer);

            new GameEngine().DoPreGameSetup(GameContext.Current);
        }

        [TestFixtureTearDown]
        public void TearDown()
        {
            GameContext.CheckAndPop(_game);
        }

        [Test]
        public void TestProductionAI()
        {
            var design = GameContext.Current.TechDatabase["FED_MK_I_SHIPYARD"] as ShipyardDesign;
            var plans =
                BuildSequenceStage.GeneratePlan(
                    new InitialProductionAction(GameContext.Current.CivilizationManagers[0].HomeColony),
                    design);
        }
    }
}
